# coding = utf-8
import redis
import openpyxl
import datetime

wb = openpyxl.load_workbook("设备警报列表_热压段1.xlsx")

sheet = wb["Sheet1"]


full_code_des_list = []
plc_address_full_code = {}

for row in sheet.rows:
    # for cell in row:
    #     # print(cell.value, end=',')
    #     print(cell.value)
    #     print(row[0], row[1])
    #
    #     list_all.append(cell.value)

    print(row[7].value, row[8].value)
    # r.set(str(row[0].value),row[1].value)
    temp_list = []
    if len(str(row[7].value)) > 4:
        temp_list.append(str(row[7].value))
        temp_list.append(str("1"))
        temp_list.append(str(row[8].value))
    full_code_des_list.append(temp_list)
    plc_address_full_code[str(row[0].value)] = str(row[7].value)


# 5052个
print(len(full_code_des_list))
print(full_code_des_list)
print(len(plc_address_full_code))
print(plc_address_full_code)


# 5052个


# print(type(AlarmCode_AlarmMsg))